home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / Samples / Moofwars 1.02 / MoofWars Encoder / •Headers / GridEncode.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-15  |  1.8 KB  |  52 lines  |  [TEXT/CWIE]

  1. /*************************************************************************************
  2. #
  3. #    GridEncode.h
  4. #
  5. #   This is just a very simple encoder that shows how to build GRID and TILE resources.
  6. #    The TILE resource is a set of 32x32x1 byte tiles.  This encoder takes a picture and
  7. #   dices it into 32x32 tiles, which it writes out to output file.  It then builds a
  8. #   standard grid, repeating the original picture as a pattern across the grid.
  9. #
  10. #   Eventually, it would be nice to make a program that lets someone graphically edit
  11. #   the available list of tiles and the actual GRID resource, much like any number
  12. #   of map editors out for various games.
  13. #
  14. #
  15. #    Author: Timothy Carroll
  16. #    Apple Developer Technical Support
  17. #    timc@apple.com
  18. #
  19. #    Modification History: 
  20. #
  21. #    8/15/96        TMC     Initial Release
  22. #
  23. #    Copyright © 1996 Apple Computer, Inc., All Rights Reserved
  24. #
  25. #
  26. #    You may incorporate this sample code into your applications without
  27. #    restriction, though the sample code has been provided "AS IS" and the
  28. #    responsibility for its operation is 100% yours.  However, what you are
  29. #    not permitted to do is to redistribute the source as "DSC Sample Code"
  30. #    after having made changes. If you're going to re-distribute the source,
  31. #    we require that you make it clear in the source that the code was
  32. #    descended from Apple Sample Code, but that you've made changes.
  33. #
  34. *************************************************************************************/
  35.  
  36. #ifndef _GRIDENCODE_
  37. #define _GRIDENCODE_
  38.  
  39. #pragma once
  40.  
  41. const int kPICTInputResID = 128;  // resource ID of the PICT to dice.
  42. const int kOutputResID = 500;     // resource ID used for the GRID and TILE output
  43.  
  44. const int kGridWidth = 44;
  45. const int kGridHeight = 44;
  46.  
  47. const int kTileSize = 1024;  // 32 x 32 x 1 byte
  48.  
  49. extern OSStatus GridTileEncode (short inputFileResNum, short outputFileResNum);
  50.  
  51. #endif // _GRIDENCODE_